package com.icloud.article.boot.controller.app;


import com.icloud.article.boot.dto.RewardDto;
import com.icloud.article.boot.service.RewardService;
import com.icloud.common.core.api.CommonResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Api(tags = "App打赏接口")
@RequestMapping("/app/reward")
@RequiredArgsConstructor
public class AppRewardController {

    private final RewardService rewardService;

    @ApiOperation("打赏,前端限制自己不能给自己打赏")
    @PostMapping("")
    public CommonResult<Boolean> reward(@Validated @RequestBody RewardDto dto){
        return CommonResult.success(rewardService.reward(dto));
    }
}
